<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>proxy</title>
</head>
<body>
    
</body>
<script>
    // Proxy 对象用于定义基本操作的自定义行为（如属性查找，赋值，枚举，函数调用等）。
    // let p = new Proxy(target, handler);
    let handler={
        get:function(target,name){
            return name in target?target[name]:37;
        }
    };
    let p=new Proxy({},handler);
    p.a=1;
    p.b=undefined;
    console.log(p.a,p.b);
    console.log('c' in p,p.c);
</script>
</html>